package com.zb.vo;

import com.zb.entity.FieldValOptionVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.List;

/**
 * @Author WEN
 * @Date 2023/8/17 0017
 **/
@Data
@ApiModel("商品自定义参数对象")
public class GoodsCustomParamVo {
    @ApiModelProperty(value = "自定义参数ID，新增不必传，修改必传")
    private Long id;

    @ApiModelProperty(value = "1-文本，2-多行文本，3-单选，4-多选，5-多图，6-附件，7-视频，8-评分", hidden = true)
    private Integer type;

    @Length(max = 20, message = "自定义参数名称限制20个字符以内")
    @ApiModelProperty(value = "自定义参数名称")
    private String name;

    @Length(max = 50, message = "自定义参数名称限制50个字符以内")
    @ApiModelProperty(value = "自定义参数值")
    private String val;

    @ApiModelProperty(value = "选项值对象")
    private List<FieldValOptionVo> optVos;

    public GoodsCustomParamVo() {
    }

    public GoodsCustomParamVo(Long id, String name, String val) {
        this.id = id;
        this.name = name;
        this.val = val;
    }

    public GoodsCustomParamVo(Long id, String name, String val, List<FieldValOptionVo> optVos) {
        this.id = id;
        this.name = name;
        this.val = val;
        this.optVos = optVos;
    }
}
